﻿using ZilLion.Service.Core.ConfigManager.Attribute;
using ZilLion.Service.Core.ConfigManager.Provider;

namespace ZilLion.Service.Core.WebSocket
{
    /// <summary>
    ///     消息持久化方式
    /// </summary>
    public enum WebSocketPersistenceType
    {
        Local = 0,
        Redis = 1,
        Sqlserver = 2
    }

    [ConfigurationArgument(typeof(WebSocketServiceConfig), typeof(JsonConfigProvider))]
    public class WebSocketServiceConfig
    {
        /// <summary>
        ///     是否开启消息持久化
        /// </summary>
        public bool EnableMessagePersistence { get; set; } = true;

        /// <summary>
        ///     消息持久化方式
        /// </summary>
        public WebSocketPersistenceType WebSocketPersistenceType { get; set; } = WebSocketPersistenceType.Local;
    }
}